package com.qf.dao;

import com.qf.entity.Profile;
import com.qf.utlis.DBUtil;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;

import java.sql.SQLException;
import java.util.List;

public class profileDaoImpl implements ProfileDao {
    private QueryRunner runner = new QueryRunner(DBUtil.getDateSource());
    @Override
    public List<Profile> selectAll() {
        String sql = "select * from profile";
        try {
            return runner.query(sql,new BeanListHandler<Profile>(Profile.class));
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return null;
    }
}
